import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;
public class ServletDemo extends HttpServlet 
{
	RequestDispatcher rd;
	public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
	{
		res.setContentType("text/html");		
		String str = req.getParameter("type");
		if(str.equals("patient"))
		{
		 rd= req.getRequestDispatcher("/patient.html");
		 rd.forward(req, res);
		}
		else if(str.equals("doctor"))
		{
			rd=req.getRequestDispatcher("/doctor.html");
			rd.forward(req,res);
		}
		else
		{
			rd=req.getRequestDispatcher("/error.html");
			rd.forward(req,res);
		}
	}
}
